<?php if ( !empty($post->post_password) && $_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) : ?>
<p><?php _e('Digita la tua password per vedere i commenti.'); ?></p>
<?php return; endif; ?>

<?php
/* This variable is for alternating comment background */
$alternatecomment = 'alt-comment-text';
?>

<h2 class="title-comments"><?php comments_number(__('Nessun Commento'), __('1 Commento'), __('% Commenti')); ?> 

<?php if ( comments_open() ) : ?>
	<a href="#postcomment" title="<?php _e("Lascia un commento"); ?>">&raquo;</a>
<?php endif; ?>
</h2>
<p class="p-comments">
<?php if (('open' == $post-> comment_status) && ('open' == $post->ping_status)) {
// Both Comments and Pings are open ?>
Puoi <a href="#postcomment">lasciare una risposta</a>, oppure fare un <a href="<?php trackback_url(true); ?>" rel="trackback">trackback</a> dal tuo sito.

<?php } elseif (!('open' == $post-> comment_status) && ('open' == $post->ping_status)) {
// Only Pings are Open ?>
Le risposte sono disabilitate, ma puoi fare un <a href="<?php trackback_url(true); ?> " rel="trackback">trackback</a> dal tuo sito.

<?php } elseif (('open' == $post-> comment_status) && !('open' == $post->ping_status)) {
// Comments are open, Pings are not ?>
Puoi <a href="#postcomment">lasciare una risposta</a> utilizzando il modulo in fondo. Il trackback non &egrave attualmente abilitato.

<?php } elseif (!('open' == $post-> comment_status) && !('open' == $post->ping_status)) {
// Neither Comments, nor Pings are open ?>
Sia i commenti che i trackback sono disabilitati.
<?php } ?>
</p>

<br/>

<?php if ($comments) : ?>
	<h3 id="comments"><?php comments_number('Nessuna Risposta', 'Una Risposta', '% Risposte' );?> a &#8220;<?php the_title(); ?>&#8221;</h3> 

	<ol class="commentlist">

	<?php foreach ($comments as $comment) : ?>

		<li class="<?php echo $oddcomment; ?>" id="comment-<?php comment_ID() ?>">
			<cite><?php comment_author_link() ?></cite> dice:
			<?php if ($comment->comment_approved == '0') : ?>
			<em>Il tuo commento &egrave in attesa di essere moderato.</em>
			<?php endif; ?>
			<br />
			
			<p class="commentmetadata"><small><a href="#comment-<?php comment_ID() ?>" title="">Pubblicato il <?php comment_date('d m Y') ?> alle <?php comment_time() ?></a> <?php edit_comment_link('edit','',''); ?></small></p>
			<?php comment_text() ?>
		</li>

	<?php /* Changes every other comment to a different class */
		if ('alt' == $oddcomment) $oddcomment = '';
		else $oddcomment = 'alt';
	?>

	<?php endforeach; /* end for each comment */ ?>
	
	</ol>

<?php else : // If there are no comments yet ?>
	<p><?php _e('Vuoi essere il primo a lasciare un commento per questo articolo? Utilizza il modulo sotto..'); ?></p>
<?php endif; ?>

<?php if ( comments_open() ) : ?>
<h3 id="postcomment"><?php _e('Lascia un commento'); ?></h3>

<?php if ( get_option('comment_registration') && !$user_ID ) : ?>
<p>Devi eseguire il <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php the_permalink(); ?>">login</a> per inviare un commento.</p>
<?php else : ?>

<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">

<?php if ( $user_ID ) : ?>

<p>Loggato come <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="<?php _e('Log out da questo account') ?>">Logout &raquo;</a></p>

<?php else : ?>

<p>
<input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" />
<label for="author"><small>Nome <?php if ($req) _e('(richiesto)'); ?></small></label><br/>

<input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" />
<label for="email"><small>E-mail (non sar&agrave; pubblicata) <?php if ($req) _e('(richiesta)'); ?></small></label><br/>

<input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" />
<label for="url"><small>Website</small></label><br/>
</p>

<?php endif; ?>

<!--<p><small><strong>XHTML:</strong> You can use these tags: <?php echo allowed_tags(); ?></small></p>-->

<p>Il tuo commento: <br/>
<textarea name="comment" id="comment" cols="30" rows="15" tabindex="4"></textarea></p>

<p><input name="submit" type="submit" id="submit" tabindex="5" value="Invia" />
<input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
</p>
<?php do_action('comment_form', $post->ID); ?>

</form>

<?php endif; // If registration required and not logged in ?>

<?php else : // Comments are closed ?>
<p><?php _e('Spiacente, i commenti sono chiusi.'); ?></p>
<?php endif; ?>